package com.liu.netty.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "sx_senor")
@Getter
@Setter
@NoArgsConstructor
//@Data
//@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id")
public class Senor {

    @Id
    private String id;

    @ManyToOne(fetch = FetchType.EAGER )
    @JoinColumn(name = "dr_id")
    @JsonBackReference
    private Driver driver;

    private Date dateTime;

    private String illumination;//光照强度

    private String humidity;// 湿度
    private String temperature ;//  温度
    private String voltage;// 电压
    private String signalStrenght;// 信号强度，值越大越好



}
